package com.wfm.service;

import java.util.HashMap;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.core.exception.DAOException;
import com.organization.service.SVC_ORGRemote;
import com.svc.OpenEJBsvc;

public class TestWF {

	/**
	 * @param args
	 * @throws NamingException 
	 */
	public static void main(String[] args) throws NamingException {
		InitialContext ctx = OpenEJBsvc.tomee_InitialContext();   
		SVC_ORGRemote svc = (SVC_ORGRemote) ctx.lookup("SVC_ORGRemote");
		
		HashMap p = new HashMap();
		p.put("PARENT_ID", "pid");
		p.put("CHILD_ID", "cid");
		p.put("PARTY_STRUCTURE_TYPE_ID", "pstid");
		p.put("WFID", "pstid");
		//svc.DEL_STRUCTURE(p);
		try{
			System.out.println(svc.getResultList("Q_WFM_DEF_WORKFLOW.GET_START_FORM_CODE"));
		}catch( Exception e){
			
			Throwable cause = e.getCause();
			while (true) {
				if (cause.getCause() == null) {
					break;
				}
				if(cause instanceof DAOException){
					DAOException dao=(DAOException)cause;
					System.out.println(dao.getExceptionInfo());
				}
				System.out.println(cause.getClass().getName());
				cause = cause.getCause();
			}
			//System.out.println(dao.getExceptionInfo());
		}
		
	
	   // svc.DO_START_PROCESS("test", "40288071328fb7e201328fc25009000a", new Date(), "bo_id", 1, "分支", "分支");
	
		// svc.DO_TASK_SUBMIT("4028808433e41b620133e41b63110003", "40288071328fb7e201328fc25009000a", new Date(), "bo_id", 0, "会合", "会合", "40288071328fb7e201328fc25009000a");
	
	  //   svc.DO_TASK_SUBMIT("4028808433e41b620133e41b63110002", "40288071328fb7e201328fc25009000a", new Date(), "bo_id", 0, "会合", "会合", "40288071328fb7e201328fc25009000a");

       // svc.DO_TASK_SUBMIT("4028810833e015b10133e015b1520000", "40288071328fb7e201328fc25009000a", new Date(), "bo_id", 0, null, null);
	}

}
